home *** CD-ROM | disk | FTP | other *** search
- // Dynamic link library implementation of NeuroSolutions IntegratorAxon component
-
- #include "NSDLL.h"
-
- /***********************************/
- /* Forward activation of component */
-
- __declspec(dllexport) void performContextAxon(
- DLLData *instance, // Pointer to instance data (may be NULL)
- NSFloat *data, // Pointer to the layer of processing elements (PEs)
- int rows, // Number of rows of PEs in the layer
- int cols, // Number of columns of PEs in the layer
- NSFloat *delayedData, // Pointer to a PE layer delayed by a single time step
- NSFloat *tau, // Pointer to a vector of time constants, one for each PE
- NSFloat beta // Linear scaling factor controlled within the components inspector
- )
- {
- int i, length=rows*cols;
-
- for (i=0; i<length; i++)
- data[i] = (NSFloat)(beta * ((1.0-tau[i])*data[i] + tau[i]*delayedData[i]));
- }
-
- /******************************************/
- /* Management of instance data (OPTIONAL) */
- /*
- __declspec(dllexport) DLLData *allocContextAxon(
- DLLData *oldInstance, // Pointer to the last instance if reallocating
- int rows, // Number of rows of PEs in the layer
- int cols // Number of columns of PEs in the layer
- )
- {
- DLLData *instance = allocDLLInstance(oldInstance);
- return instance;
- }
-
- __declspec(dllexport) void freeContextAxon(DLLData *instance)
- {
- freeDLLInstance(instance);
- }
- */